package com.alm.web.controller.alm.devusepower;

import com.alm.common.core.controller.BaseController;
import com.alm.common.core.domain.AjaxResult;
import com.alm.common.core.page.TableDataInfo;
import com.alm.handle.service.ISysDevCurrentData_sService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/alm/dev/usepower")
public class AlmDevRealtimeInfoController extends BaseController {

    @Autowired
    private ISysDevCurrentData_sService sysDevCurrentDataSService;

    @PreAuthorize("@ss.hasRole('common')")
    @GetMapping(value = "/findChildrenByMac/{devId}")
    public TableDataInfo findChildrenByMac(@PathVariable String devId)
    {
        startPage();
        return getDataTable(sysDevCurrentDataSService.findByMac(devId));
    }

    @PreAuthorize("@ss.hasRole('common')")
    @GetMapping(value = "/findChildrenDataByMac/{devId}")
    public TableDataInfo findChildrenDataByMac(@PathVariable String devId)
    {
        return getDataTable(sysDevCurrentDataSService.findByMacByData(devId));
    }


}
